import request from '@/utils/request'

// 查询学生还款列表
export function listPayOrderData(query) {
  return request({
    url: '/repay/data/list',
    method: 'get',
    params: query
  })
}

// 查询学生还款详细
export function getData(repayId) {
  return request({
    url: '/student/repay/data/' + repayId,
    method: 'get'
  })
}

// 新增学生还款
export function addData(data) {
  return request({
    url: '/student/repay/data',
    method: 'post',
    data: data
  })
}

// 修改学生还款
export function updateData(data) {
  return request({
    url: '/student/repay/data',
    method: 'put',
    data: data
  })
}

// 删除学生还款
export function delData(repayId) {
  return request({
    url: '/student/repay/data/' + repayId,
    method: 'delete'
  })
}

// 导出学生还款
export function exportData(query) {
  return request({
    url: '/student/repay/data/export',
    method: 'get',
    params: query
  })
}

// 发起支付
export function doPay(data) {
  return request({
    url: '/repay/data/pay',
    method: 'post',
    data: data
  })
}

// 支付宝真支付
export function realPay(data) {
  return request({
    url: '/repay/data/realPay',
    method: 'post',
    data: data
  })
}

// 微信真支付
export function wxPay(data) {
  return request({
    url: '/repay/data/wxPay',
    method: 'post',
    data: data
  })
}

// 根据userId和最新时间查询最新支付订单记录
export function newOneByUserIdAndNewAddTime(userId) {
  return request({
    url: '/repay/data/newOneByUserIdAndNewAddTime/' + userId,
    method: 'get',
    params: userId
  })
}

// 根据贷款申请表ID查询支付还款信息
export function getRepaysByCreditId(creditId) {
  return request({
    url: '/student/repay/data/creditRepay/' + creditId,
    method: 'get'
  })
}

// 获取指定支付编号内的最大时间的记录
export function selectRepayByMaxDate(data) {
  return request({
    url: '/student/repay/data/maxDate',
    method: 'post',
    data: data
  })
}

// 根据当前用户名查询该用户的订单
export function selectPayOrderListBySysUser(userName) {
  return request({
    url: '/repay/data/selectPayOrderListBySysUser/' + userName,
    method: 'get',
    params: userName
  })
}
